package approve.action;

import resource.pojo.Approvedoc;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class My_ViewForm15_tab extends TabActivity {

	Bundle language;
	Approvedoc AppDoc = null;
	
	String lang = "EN",database="admin";
	public String getLang() {
		Bundle extras = getIntent().getExtras();
		if (extras != null) {
			lang = extras.getString("lang");
		}
		return lang;
	}
	
	public String getDatabase() {
		Bundle extras = getIntent().getExtras();
		if (extras != null) {
			database = extras.getString("database");
		}
		return database;
	}
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.my_viewform15);
		
		loadBunlde();
		
		Resources res=getResources();
		TabHost tabHost=getTabHost();
		TabHost.TabSpec spec;
		Intent intent;
		

		intent=new Intent().setClass(My_ViewForm15_tab.this, My_ViewForm15_Approver.class);
		spec=tabHost.newTabSpec("Approver").setIndicator("Approver",res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);
		addIntent(intent);
//		loadBunlde();
		tabHost.addTab(spec);
		
		intent=new Intent().setClass(My_ViewForm15_tab.this, My_ViewForm15_Information.class);
		spec=tabHost.newTabSpec("Information").setIndicator("Information", res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);
		addIntent(intent);
//		loadBunlde();
		tabHost.addTab(spec);
		intent=new Intent().setClass(My_ViewForm15_tab.this, My_ViewForm15_Detail.class);
		spec=tabHost.newTabSpec("Detail").setIndicator("Detail", res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);
//		addIntent(intent);
//		loadBunlde();
		tabHost.addTab(spec);
	}

	private void loadBunlde() {
		Intent i=this.getIntent();
		AppDoc=(Approvedoc)i.getSerializableExtra("AppDoc");
		language=getIntent().getExtras().getBundle(getLang());
	}
	
	private void addIntent(Intent intent){
		intent.putExtras(getIntent().getExtras());
		intent.putExtra("AppDoc", AppDoc);
		intent.putExtra("database", getDatabase());
//		startActivity(intent);
	}
}
